package com.shopping.controller;

import com.shopping.dao.BlogMapper;
import com.shopping.entity.Blog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class BlogController {

    @Autowired
    private BlogMapper blogMapper;

    @GetMapping("/list/{id}")
    public List<Blog> list(@PathVariable("id") Integer id){
        List<Blog> blogs = blogMapper.selectBlog(id);
        return blogs;
    }
}
